<template>
  <div>
    <!--导航栏-->
    <!-- <div v-if="isAuth==='0'">
      <div tag="div" class="header-wrapper">
        <div class="left">
          <div class="logo">
            <img src="@/assets/images/head_portrait.png" class="avatar" alt="logo" />
          </div>
          <router-link to="/real_name">
            <div class="headerFont">点此实名认证</div>
          </router-link>
        </div>
        <div class="right">
          <router-link to="/points-exp?code=0">
            <img :src="coinRule" alt="logo" />
          </router-link>
          <router-link to="/points-exp?code=1">
            <img :src="orderDetail" alt="logo" />
          </router-link>
        </div>
      </div>
    </div>-->
    <router-link tag="div" class="header-wrapper" :to="isAuth === '1'?'/personInfo':'/real_name'">
      <div class="left">
        <div class="logo">
          <img
            :src="isAuth==='1'?userInfo.headimgurl:require('@/assets/images/head_portrait.png')"
            class="avatar"
            alt="logo"
          />
        </div>
        <div class="headerFont">
          <div class="name" v-if="isAuth === '1'">
            <p>{{userInfo && userInfo.username.slice(0,1)}} {{userInfo.sex==='1'?"先生":userInfo.sex==='2'?"女士":""}}</p>
            <p class="p2">已实名认证</p>
          </div>
          <div class="name" v-if="isAuth === '0'">
            <p class="p2" @click="toAuth">点击实名认证</p>
          </div>
          <div class="coin_num">
            <!-- <span class="coin_icon"></span> -->
            <p>我的积分</p>
            <p style="font-size:35px">{{currentNum}}</p>
          </div>
        </div>
        <!-- <router-link :to="isAuth === '1'?'/personInfo':'/real_name'">
          <img :style="{width:'9px'}" src="@/assets/images/home/Arrow.png" alt />
        </router-link>-->
      </div>
      <!-- <div class="myList" v-if="isAuth === '1'">
        <router-link to="/coinDetail" class="list_item">
          <p>{{currentNum}}</p>
          <p :style="{color:'yellow'}">当前积分</p>
        </router-link>
        <p class="line"></p>
        <router-link to="/myOrder" class="list_item">
          <p>{{orderlsit.length}}</p>
          <p>我的订单</p>
        </router-link>
        <p class="line"></p>
        <router-link to="/mycoupon" class="list_item">
          <p>{{CouponNumList.length}}</p>
          <p>优惠券</p>
        </router-link>
        <p class="line"></p>
        <router-link to="/coinDetail" class="list_item">
          <img
            src="@/assets/images/home/detail.png"
            alt
            :style="{width:'20px','margin-botttom':'20px'}"
          />
          <p :style="{'margin-top':'7px'}">积分明细</p>
        </router-link>
      </div>-->
      <div class="right">
        <!-- <router-link to="/points-exp?code=0">
          <img :src="coinRule" alt="logo" />
        </router-link>
        <router-link to="/points-exp?code=1">
          <img :src="orderDetail" alt="logo" />
        </router-link>-->
        <router-link to="/coinDetail">
          <img :src="coinDetail" alt="logo" style="margin-top:30px" />
          <!-- <div class="coindet">积分明细</div> -->
        </router-link>
      </div>
      <!-- <div class="myMessage"></div> -->
    </router-link>
    <div class="head-cell">
      <p class="title">
        <span class="icon"></span>客户服务
      </p>
      <!-- <p class="right">
        <a>更多</a>
        <img class="rightBtn" :src="imgRight" alt="logo" />
      </p>-->
    </div>
    <div class="menu-wrapper">
      <!-- <router-link tag="div" class="item" to="/activity"> -->
      <!-- <router-link tag="div" class="item" to="/activity">
        <span class="icon act"></span>
        <img class="hot" src="@/assets/images/equity/hot.png" alt />
        <p>活动中心</p>
      </router-link>-->
      <router-link tag="div" class="item" to="/myOrder">
        <span class="icon my_order"></span>
        <p>我的订单</p>
      </router-link>
      <router-link tag="div" class="item" to="/mycoupon">
        <span class="icon coupon"></span>
        <p>我的优惠券</p>
      </router-link>
      <!-- <router-link tag="div" class="item" to="/hotInfor">
        <span class="icon hot_new"></span>
        <p>热点资讯</p>
      </router-link>-->
      <router-link tag="div" class="item" to="/points-exp?code=0">
        <span class="icon hot_new"></span>
        <p>积分规则</p>
      </router-link>
      <router-link tag="div" class="item" to="/points-exp?code=1">
        <span class="icon get_order"></span>
        <p>下单流程</p>
      </router-link>
      <router-link tag="div" class="item" to="/points">
        <span class="icon gift_mail"></span>
        <p>权益商城</p>
      </router-link>
      <!-- <router-link tag="div" class="item" to="/integral-shop"> -->
    </div>

    <!--  优惠券轮播 -->
    <div class="couponList" v-if="couponLIst.length>0">
      <div class="head-wrapper">
        <span class="get_center">
          <span class="coupon_icon"></span>
          领券中心
        </span>
        <router-link tag="span" class="more" to="/points-exp?code=2">优惠券规则</router-link>
      </div>
      <div class="van_swipe_item">
        <div
          :class="['swipe_item', items.coin<=30?'coupon_bg1':items.coin<=50?'coupon_bg2':items.coin<=100?'coupon_bg3':items.coin<=300?'coupon_bg4':'coupon_bg5']"
          v-for="(items,indexs) in couponLIst"
          :key="indexs"
          @click="getCoupon(items)"
        >
          <div class="item">
            <div class="coupon_info">
              <span class="condition">{{items.detail}}</span>
              <span class="num">{{items.discountValue}}</span>
              <span class="coupon_type">{{items.name}}</span>
              <span>剩余数量：{{items.stock}}</span>
            </div>
            <div class="toGet">
              <span>立即领取</span>
              <p>（消耗{{items.coin}}积分）</p>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 热门活动 -->
    <!-- <div :style="{'margin-top':0}" class="couponList" v-if="actList.length>0">
      <div class="head-wrapper">
        <span class="get_center">
          <span class="coupon_icon_one"></span>
          热门活动
        </span>
        <router-link tag="span" class="more" to="/activity">查看更多</router-link>
      </div>
      <div class="van_swipe_item">
        <div
          class="swipe_item_img"
          v-for="(items,indexs) in actList"
          :key="indexs"
          @click="toActlist(items)"
        >
          <img :src="items.imgUrl" alt />
          <div class="item">
            <p>{{items.sourceName}}</p>
            <p>{{items.startDate}}-{{items.endDate}}</p>
          </div>
        </div>
      </div>
    </div>-->
    <!-- 热门活动产品推荐 -->
    <div v-if="hotList.length>0" class="product_hot">
      <!-- 定位浮窗 -->
      <!-- <div class="hot_img">
        <router-link tag="span" class="more" to="/activity">
          <img src="@/assets/images/equity/hot2.png" alt />
        </router-link>
        <router-link tag="span" class="more" to="/points">
          <img src="@/assets/images/equity/hot1.png" alt />
        </router-link>
      </div>-->
      <div class="head-wrapper">
        <span class="get_center">
          <span class="icon"></span>
          热门产品推荐
        </span>
        <router-link tag="span" class="more" to="/points">查看更多</router-link>
      </div>
      <ul class="gift-ul">
        <router-link
          class="gift-item"
          tag="li"
          :to="{path: item.buyLimit === 0 ? '/error':'/points/detail', query:{ id: item.id}}"
          v-for="item in hotList"
          :key="item.id"
        >
          <div class="gift-pic">
            <img v-lazy="imgBaseUrl+item.ico" alt class="pic" />
          </div>
          <div class="info">
            <h2 class="name">{{item.subTitle}}</h2>
            <div class="sku" v-if="item.skuList.length>0">
              <p v-for="(items,indexs) in item.skuList" :key="indexs">{{items}}</p>
            </div>
            <!-- <div class="num">
              {{item.coin > 10000 ? parseFloat((item.price / 10000).toFixed(2)) + '万':item.coin}}
              <span>积分</span>
              <img src="@/assets/images/hot.png" class="limit">
            </div>-->
            <!-- <del>{{(item.superCoin>item.coin)?item.superCoin+' 积分':''}}</del>
            <p v-if="item.price">总价：¥ {{item.price > 10000 ? parseFloat((item.price / 10000).toFixed(2)) + '万':item.price}}</p>
            <p>库存：{{item.limitNum}}</p>-->
          </div>
          <button
            class="exchange-btn"
            :class="{'no-stock':item.limitNum===0}"
          >{{item.limitNum !==0 ? '立即购买' : '敬请期待'}}</button>
        </router-link>
      </ul>
    </div>
    <!-- 活动弹窗 -->
    <div class="act_toast" v-if="showToa">
      <div class="toast_item">
        <img class="toast_img" src="@/assets/images/turntable/grounp1.png" alt />
        <img
          @click="toActivity"
          class="toast_btn"
          :style="{width:'165px','align-self':'center'}"
          src="@/assets/images/turntable/joinBtn.png"
          alt
        />
        <img
          @click="activityImg"
          :style="{width: '34px','margin-top':'20px','align-self':'center'}"
          src="@/assets/images/turntable/turnoff.png"
          alt
        />
      </div>
    </div>
    <footer>
      <p>©邮储银行厦门分行</p>
      <p>技术支持【银联商务厦门分公司】</p>
    </footer>
  </div>
</template>

<script>
import Vue from 'vue';
import { Button, Dialog } from 'vant';
import { imgBaseUrl, baseUrl } from '@/config/env';
import weixin from '@/components/wx/wx.js';
// import moment from 'moment';
Vue.use(Dialog);
export default {
  data() {
    return {
      imgBaseUrl,
      animate: false,
      coinRule: require('@/assets/images/coin_rule.png'),
      coinDetail: require('@/assets/images/coinDetail1.png'),
      orderDetail: require('@/assets/images/order_circuit.png'),
      data: {},
      currentNum: '', // 当前积分
      userInfo: null,
      isAuth: null,
      couponLIst: [],
      hotList: [],
      actList: [],
      orderlsit: [],
      CouponNumList: [],
      showToa: true
    };
  },
  mounted() {
    if (window.sessionStorage.getItem('toast') === 'key') {
      console.log(window.sessionStorage.getItem('toast'));
      this.showToa = false;
    }
    this.currentUserInfo();
    this.getCouponList();
    this.getHotProductList();
    this.initWxChat();
    this.getActlist();
    this.getOrderList();
    this.getCouponNum();
  },
  methods: {
    initWxChat() {
      const url = window.location.href.split('#')[0];
      const param = {
        title: '邮储银行厦门分行积分兑换活动',
        desc: '限量优惠券大放送，领券下单更优惠！',
        link:
          baseUrl + 'entrance/goto?redir=' + window.location.href.split('#')[1],
        imgUrl:
          'http://img.580travel.com/ticket/b9ed3290-db74-11e9-a515-c13cae82320b',
        localUrl: url
      };
      weixin.wxChat(this, param);
    },
    // 获取单张优惠券
    getCoupon(item) {
      if (this.isAuth === '0') {
        Dialog.confirm({
          title: '提示',
          message: '您还未实名认证',
          cancelButtonText: '再看看',
          confirmButtonText: '去认证'
        })
          .then(() => {
            this.$router.replace('/real_name');
          })
          .catch(() => {});
      } else {
        console.log(item);
        Dialog.confirm({
          confirmButtonColor: '#28b46a',
          // title: '提示',
          message:
            '您将使用' +
            item.coin +
            '积分领取该优惠券,该优惠券仅可在邮储银行卡支付下使用，您确定领取该优惠券吗?'
        }).then(() => {
          // if (moment().isBefore('2019-12-21')) {
          this.$http
            .post('/tuserCoupon/add', { couponId: item.id.toString() })
            .then(res => {
              console.log(res);
              if (res.data.code === '0') {
                Dialog.alert({
                  confirmButtonColor: '#28b46a',
                  title: '提示',
                  message: '您成功领取该优惠券,可在我的优惠券中查看'
                }).then(() => {
                  this.currentUserInfo();
                  this.getCouponList();
                });
              } else {
                Dialog.alert({
                  confirmButtonColor: '#28b46a',
                  title: '提示',
                  message: res.data.message
                }).then(() => {
                  this.currentUserInfo();
                  this.getCouponList();
                });
              }
            });
          // } else {
          //   Dialog.alert({
          //     confirmButtonColor: '#28b46a',
          //     title: '提示',
          //     message:
          //       '邮储积分兑换活动已于2019年12月20日结束，已兑换产品请于2019年12月31日前核销，来不及核销的产品请自行保存好卡号卡密等关键信息，本活动链接将于2019年12月31日后开始升级，升级后所有记录清零！'
          //   }).then(() => {
          //     this.currentUserInfo();
          //     this.getCouponList();
          //   });
          // }
        });
      }
    },
    // 获取用户信息
    currentUserInfo() {
      this.$http.post('/tuser/userInfo', {}).then(res => {
        if (res) {
          if (res.data.code === '0') {
            this.userInfo = res.data.object;
            this.currentNum = res.data.object.coinAmount;
            this.isAuth = res.data.object.isAuth;
            console.log(this.isAuth);
          }
        }
      });
    },
    getCouponList() {
      this.$http.post('/coupon/list', { pageSize: 1000 }).then(res => {
        if (res.data.list.length > 0) {
          this.couponLIst = res.data.list;
        }
      });
    },
    getHotProductList() {
      this.$http.post('/product/hotList').then(res => {
        this.hotList = res.data.object;
      });
    },
    toAuth() {
      this.$router.push('/real_name');
    },
    toProduct(item) {
      if (this.isAuth === '0') {
        Dialog.confirm({
          title: '提示',
          message: '您还未实名认证',
          cancelButtonText: '再看看',
          confirmButtonText: '去认证'
        })
          .then(() => {
            this.$router.replace('/real_name');
          })
          .catch(() => {});
      } else {
        this.$router.push({
          path: item.buyLimit === 0 ? '/error' : '/points/detail',
          query: { id: item.id }
        });
      }
    },
    getActlist() {
      this.$http.post('/activity/list').then(res => {
        console.log(res);
        this.actList = res.data.list;
      });
    },
    toActlist(items) {
      this.$router.push('/' + items.url);
    },
    getOrderList() {
      this.$http.post('/order/list', {}).then(res => {
        console.log(res.data.list.length);
        this.orderlsit = res.data.list;
      });
    },
    getCouponNum() {
      this.$http.post('/tuserCoupon/list', {}).then(res => {
        console.log(res);
        this.CouponNumList = res.data.list;
      });
    },
    toActivity() {
      this.$router.push('/turntableCoin');
      window.sessionStorage.setItem('toast', 'key');
    },
    activityImg() {
      this.showToa = false;
      window.sessionStorage.setItem('toast', 'key');
    }
  },
  components: {
    'van-button': Button
  }
};
</script>

<style lang="scss" scoped>
.header-wrapper {
  position: relative;
  height: 300px;
  // background-image: linear-gradient(163deg, #26a1f1 40%, #4388ef 100%);
  background-image: url('../../assets/images/bg.png');
  background-size: 100% 100%;
  display: flex;
  flex-direction: column;
  // align-items: center;
  .signin-tag {
    width: 162px;
    background-color: #ffc400;
    border-radius: 25px 0 0 25px;
    @include sc(26px, #454545);
    position: absolute;
    right: 0;
    top: 20px;
    text-align: center;
    line-height: 50px;
    cursor: pointer;
    text-indent: 12px;
  }
  .left {
    width: 700px;
    height: 141px;
    margin-left: 38px;
    margin-top: 20px;
    display: flex;
    // justify-content: space-around;
    // align-items: center;
    flex-direction: row;
    .logo {
      float: left;
      width: 80px;
      height: 80px;
      margin-right: 30px;
      img {
        width: 141px;
        display: block;
        border-radius: 50%;
      }
    }
    .headerFont {
      width: 370px;
      align-items: center;
      @include sc(26px, #fff);
      .name {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-top: 15px;
        .p2 {
          width: 165px;
          font-size: 22px;
          padding: 6px 7px;
          border: 1px solid #fff;
          border-radius: 8px;
          text-align: center;
          margin-left: 20px;
        }
      }
      .total {
        width: 100%;

        @include sc(26px, #fff);
        margin-top: 30px;
      }
      .coin_num {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        margin-top: 55px;
        margin-left: -450px;
        .coin_icon {
          display: block;
          width: 40px;
          height: 40px;
          margin-right: 10px;
          background-image: url(../../assets/images/star.png);
          background-size: 100% 100%;
          font-size: 30px;
        }
        p {
          font-size: 30px;
        }
      }
    }
  }
  .right {
    position: absolute;
    right: 0px;
    top: 50px;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: space-between;
    .coindet {
      width: 150px;
      height: 45px;
      background-color: #feed62;
      color: red;
      line-height: 49px;
      text-align: center;
      border-radius: 25px;
    }
    a {
      display: block;
      margin: 10px 0;
      img {
        width: 163px;
      }
    }
  }
}
.myMessage {
  width: 710px;
  height: 199px;
  background-color: #ffffff;
  border-radius: 10px;
  position: absolute;
  top: 360px;
  align-self: center;
}
.myList {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-top: 42px;
  .line {
    width: 1px;
    height: 30px;
    background-color: #fff;
  }
  .list_item {
    width: 249px;
    text-align: center;
    :first-child {
      font-size: 40px;
      color: #fff;
    }
    :nth-child(2) {
      font-size: 24px;
      color: #fff;
    }
  }
}
.integral-wrapper {
  height: 150px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  .left {
    display: flex;
    min-width: 248px;
    align-items: center;
    flex-direction: column;
    // background-image: url(../../assets/images/more-arrows.png);
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 20px;
    .number {
      color: #000000;
      font-size: 38px;
    }
    .txt {
      color: #989898;
      font-size: 28px;
    }
  }
  .right {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 341px;
    height: 70px;
  }
  .signBtn {
    width: 160px;
    height: 70px;
    line-height: 70px;
    text-align: center;
    font-size: 26px;
    background-color: #3889ff;
    border-radius: 8px;
    border: none;
    color: #ffffff;
  }
  .integral {
    width: 160px;
    height: 70px;
    background-color: white;
    border: 1px solid #3889ff;
    border-radius: 8px;
    color: #3889ff;
    font-size: 26px;
    text-align: center;
    line-height: 70px;
  }
}
.head-cell {
  height: 75px;
  background-color: #ffffff;
  padding: 0 25px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #ebebeb;
  .title {
    color: #454545;
    font-size: 30px;
    .icon {
      width: 31px;
      height: 32px;
      display: inline-block;
      @include bis('../../assets/images/customer_service.png');
      vertical-align: sub;
      margin-right: 15px;
    }
  }
  .right {
    display: flex;
    align-items: center;
    a {
      color: #454545;
      font-size: 30px;
      float: left;
    }
    img {
      margin-left: 5px;
      height: 25px;
      color: #ccc;
    }
  }
}
.menu-wrapper {
  width: 750px;
  height: 199px;
  border-radius: 10px;
  background-color: #ffffff;
  display: flex;
  // margin-left: 20px;
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  // margin-bottom: 30px;
  // position: absolute;
  // top: 350px;
  justify-content: space-around;
  .item {
    width: 20%;
    // min-width: 187.5px;
    height: 167px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    .hot {
      width: 50px;
      position: absolute;
      top: 0;
      right: 10px;
    }
    img {
      height: 53px;
      margin-bottom: 20px;
    }
    .icon {
      width: 82px;
      height: 82px;
      background-size: 100% 100%;
      background-repeat: no-repeat;
      margin-bottom: 20px;
      &.act {
        background-image: url(../../assets/images/act.png);
      }
      &.my_order {
        background-image: url(../../assets/images/my_order.png);
      }
      &.coupon {
        background-image: url(../../assets/images/coupon.png);
      }
      &.hot_new {
        background-image: url(../../assets/images/hot_new.png);
      }
      &.get_order {
        background-image: url(../../assets/images/home/linc.png);
      }
      &.gift_mail {
        background-image: url(../../assets/images/gift_mail.png);
      }
    }
    p {
      color: #454545;
      font-size: 26px;
    }
  }
}
.cover {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  padding-left: 18px;
  padding-right: 17px;
  .middleBox {
    width: 10rem;
    margin: 0 auto;
    height: 586px;
    .signImg {
      width: 100%;
      height: 280px;
      .ImgSize {
        height: 306px;
      }
    }
    .signFooter {
      width: 511px;
      height: 300px;
      margin: 0 auto;
      background-color: #ffffff;
      border-radius: 30px;
      display: flex;
      align-items: center;
      flex-direction: column;
      .signFooterOne {
        width: 318px;
        height: 42px;
        color: #020202;
        font-size: 34px;
        letter-spacing: 2px;
        margin-top: 71px;
      }
      .signFooterTwo {
        width: 450px;
        height: 88px;
        background-color: #3889ff;
        border-radius: 8px;
        color: #ffffff;
        font-size: 32px;
        border: none;
        margin-top: 71px;
      }
    }
  }
}
.secret-popup {
  padding: 20px;
  p {
    padding: 20px;
  }
}
.info-wrapper {
  width: 690px;
  box-shadow: 0px 1px 10px 0px rgba(181, 184, 185, 0.75);
  border-radius: 20px;
  height: 120px;
  background-color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 36px;
  margin: -20px auto 20px;
  position: relative;
  z-index: 2;
  .left {
    display: flex;
    align-items: center;
    .info {
      border-right: 1px solid #ebebeb;
      padding-right: 30px;
      margin-right: 30px;
    }
    .num {
      font-size: 24px;
      color: #626262;
    }
    .exp {
      @include sc(28px, #626262);
    }
  }
  .right {
    height: 60px;
    text-align: center;
    line-height: 60px;
    background-image: linear-gradient(270deg, #4388ef 0%, #26a1f1 100%);
    border-radius: 8px;
    font-size: 28px;
    color: #fff;
    padding: 0 12px;
  }
}
.member {
  font-size: 28px;
  color: #454545;
  margin-bottom: 16px;
  .member-icon {
    width: 46px;
    height: 46px;
    margin-right: 5px;
    display: inline-block;
    vertical-align: bottom;
    background-image: url('../../assets/images/vip_icon.png');
    background-repeat: no-repeat;
    background-size: 313px;
    &.vip1 {
      background-position: 0 -50px;
    }
    &.vip2 {
      background-position: -90px -50px;
    }
    &.vip3 {
      background-position: -172px -50px;
    }
    &.vip4 {
      background-position: -252px -50px;
    }
  }
}
.featured-wrapper {
  display: flex;
  background-color: #fff;
  justify-content: center;
  margin-bottom: 30px;
  .item {
    min-width: 333px;
    height: 260px;
    position: relative;
    display: flex;
    padding: 20px 25px;
    flex-direction: row;
    border-right: 1px solid #ebebeb;
    display: flex;
    flex: 1;
    &:last-child {
      border-right: none;
    }
    .icon {
      margin-right: 11px;
      height: 33px;
      vertical-align: text-top;
    }
    .name {
      font-size: 30px;
      color: #363636;
    }
    .desc {
      font-size: 24px;
      color: #9b9b9b;
    }
    .left-goods {
      position: absolute;
      bottom: 20px;
      left: 20px;
      .pic {
        width: 151px;
        height: 80px;
      }
      .name {
        font-size: 20px;
        color: #9b9b9b;
        width: 151px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin-top: 15px;
      }
    }
    .right-goods {
      width: 144px;
      height: 144px;
      position: absolute;
      right: 25px;
      bottom: 20px;
    }
  }
}

.coin-push {
  height: 75px;
  background-color: #ffffff;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 30px;
  border-bottom: 1px solid #ebebeb;
  .title {
    font-size: 30px;
    color: #454545;
    margin-right: 50px;
  }
}
.scroll-wrap {
  width: 350px;
  height: 60px;
  display: flex;
  flex: 1;
  overflow: hidden;
  .icon {
    line-height: 1;
    display: inline-block;
    padding: 6px 8px;
    border-radius: 5px;
    color: #fff;
    background-color: #f30008;
  }
  .scroll-content {
    height: 60px;
    overflow: hidden;
    li {
      font-size: 26px;
      text-align: center;
      line-height: 60px;
      a {
        color: #4d4d4d;
      }
    }
    &.marquee_top {
      transition: all 0.4s;
      margin-top: -55px;
    }
  }
}
.goods-wrapper {
  background-color: #fff;
  margin-bottom: 30px;
  .head {
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid #f2f2f2;
    .title-icon {
      height: 42px;
    }
  }
}

.coin-wrapper {
  width: 100%;
  overflow: hidden;
}
.coin-list {
  margin-top: 20px;

  .gift-item {
    display: inline-block;
    width: 232px;
    // height: 413px;
    background-color: #ffffff;
    box-shadow: 0 0 10px #cecece;
    position: relative;
    margin-bottom: 20px;
    margin-left: 22px;
    &:last-child {
      border-bottom: none;
    }
    .gift-pic {
      height: 227px;
      display: flex;
      align-items: center;
      justify-content: center;
      .pic {
        width: 100%;
        height: 100%;
      }
    }
    .info {
      padding: 0 10px;
      .name {
        font-size: 19px;
        color: #000000;
        font-weight: 400;
        min-height: 58px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        word-break: break-all;
        margin: 15px 0 0;
      }
      .num {
        color: #ff010d;
        font-size: 18px;
        display: flex;
        align-items: center;
        .limit {
          height: 20px;
          margin-right: 10px;
        }
        span {
          font-size: 18px;
        }
      }
      p {
        font-size: 16px;
        color: #8b8a8a;
      }
      del {
        font-size: 16px;
        color: #8b8a8a;
        display: block;
        height: 25px;
      }
    }
    .exchange-btn {
      position: absolute;
      right: 10px;
      bottom: 15px;
      background-color: #fff;
      color: #3889ff;
      border: 1px solid #3889ff;
      border-radius: 8px;
      font-size: 18px;
      display: inline-block;
      &.no-stock {
        color: #fff;
        border: 1px solid #b7b6b7;
        background-color: #b7b6b7;
      }
    }
  }
}
.mask {
  position: fixed;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 99;
}
.confirm-popup {
  text-align: center;
  padding: 30px;
  width: 528px;
  position: relative;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  border-radius: 20px;
  padding-bottom: 100px;
  padding-top: 181px;
  background-image: url('http://img.580travel.com/image/bocm/workerprize/back.png');
  background-size: 100%;
  background-repeat: no-repeat;
  margin-left: -10px;
  p {
    font-size: 44px;
    color: #030303;
    text-align: center;
    text-indent: 50px;
  }
  .btn {
    width: 330px;
    height: 80px;
    background-color: #3889ff;
    border-radius: 40px;
    font-size: 36px;
    color: #ffffff;
    border: none;
    margin-top: 368px;
    margin-left: 30px;
  }
  .close-icon {
    width: 50px;
    height: 50px;
    background-image: url('http://img.580travel.com/image/bocm/workerprize/closeico.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    display: inline-block;
    position: absolute;
    right: -20px;
    top: -60px;
    cursor: pointer;
  }
}
.rule-tips {
  @include bis('../../assets/images/rule_tips.png');
  width: 127px;
  height: 127px;
  position: fixed;
  right: 20px;
  bottom: 120px;
  z-index: 3;
  // animation: fit 1.2s ease-in-out 0.5s infinite alternate;
}
@keyframes fit {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(5px, 70px);
  }
}
.gift-ul {
  background-color: #ffffff;
  display: flex;
  flex-wrap: wrap;
  .gift-item {
    display: flex;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #ebebeb;
    position: relative;
    padding: 36px 30px;
    &:last-child {
      border-bottom: none;
    }
    .gift-pic {
      height: 210px;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      .pic {
        height: 100%;
        width: 100%;
      }
    }
    .info {
      padding: 0 20px;
      .name {
        @include sc(28px, #000);
        line-height: 38px;
        font-weight: 400;
        padding-bottom: 16px;
        max-height: 75px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        word-break: break-all;
        margin: 6px 0 0;
        width: 446px;
      }
      .sku {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        p {
          display: flex;
          align-items: center;
          justify-content: center;
          // width: 72px;
          // height: 35px;
          border-radius: 3px;
          border: solid 1px #fc0208;
          font-size: 18px;
          color: #fc0208;
          line-height: 30px;
          text-align: center;
          margin-left: 10px;
          margin-top: 10px;
        }
      }
      .num {
        @include sc(28px, #ff010d);
        display: flex;
        align-items: center;
        .limit {
          height: 32px;
          margin-left: 10px;
        }
        span {
          font-size: 28px;
        }
      }
      p {
        @include sc(24px, #8b8a8a);
      }
      del {
        @include sc(24px, #8b8a8a);
        display: block;
        height: 30px;
      }
    }
    .exchange-btn {
      position: absolute;
      right: 10px;
      bottom: 16px;
      width: 180px;
      height: 55px;
      line-height: 50px;
      background-color: #28b46a;
      border: 1px solid #28b46a;
      border-radius: 8px;
      @include sc(22px, #fff);
      &.no-stock {
        color: #fff;
        background-color: #fff;
        border: 1px solid #b7b6b7;
        background-color: #b7b6b7;
      }
    }
  }
}
.product_hot {
  position: relative;
  .hot_img {
    position: fixed;
    top: 800px;
    left: 20px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    img {
      width: 130px;
      margin-top: 20px;
    }
  }
}
.head-wrapper {
  height: 75px;
  background-color: #fff;
  padding: 0 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  @include sc(30px, #454545);
  border-bottom: 2px solid #ebebeb;
  .get_center {
    font-size: 30px;
    color: #454545;
    // margin-right: 50px;
    // font-weight: bold;
  }
  .icon {
    width: 32px;
    height: 32px;
    display: inline-block;
    @include bis('../../assets/images/recommend.png');
    vertical-align: sub;
    margin-right: 15px;
  }
  .coupon_icon {
    width: 45px;
    height: 35px;
    display: inline-block;
    @include bis('../../assets/images/coupon.png');
    vertical-align: sub;
    // margin-right: 15px;
  }
  .coupon_icon_one {
    width: 45px;
    height: 35px;
    display: inline-block;
    @include bis('../../assets/images/my_order.png');
    vertical-align: sub;
    // margin-right: 15px;
  }
  .more {
    color: #28b46a;
    background-image: url('../../assets/images/more-arrows.png');
    background-repeat: no-repeat;
    background-size: 13px;
    padding-right: 25px;
    background-position: center right;
  }
}
.couponList {
  margin-bottom: 30px;
  background-color: white;
  height: 444px;
  margin-top: 30px;
  .van_swipe_item {
    height: 369px;
    background-color: white;
    white-space: nowrap;
    overflow: scroll;
    // padding: 18px 0 18px 0;
    .swipe_item_img {
      width: 460px;
      background-size: 100% 100%;
      overflow: hidden;
      margin: 0 0 0 15px;
      display: inline-block;
      margin-top: 30px;
      .item {
        margin-top: 20px;
        :first-child {
          font-size: 24px;
        }
        :nth-child(2) {
          font-size: 20px;
          padding-top: 10px;
          color: #424242;
        }
      }
    }
    .swipe_item {
      width: 210px;
      height: 305px;
      background-size: 100% 100%;
      overflow: hidden;
      margin: 0 0 0 5px;
      display: inline-block;
      margin-top: 30px;
      .coupon_info {
        height: 222px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        color: white;
        margin-top: 10px;
        span {
          font-size: 20px;
        }
        .num {
          font-size: 74px;
          // margin-top: 51px;
          line-height: 55px;
          margin-bottom: 16px;
        }
        .condition {
          font-size: 22px;
          margin-bottom: 10px;
        }
        .coupon_type {
          height: 25px;
          line-height: 25px;
        }
      }
      .toGet {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        span {
          color: #28b46f;
          font-size: 26px;
        }
        p {
          color: #959595;
          font-size: 20px;
        }
      }
    }
    .coupon_bg1 {
      background-image: url(../../assets/images/coupon_bg_blue.png);
    }
    .coupon_bg2 {
      background-image: url(../../assets/images/coupon_bg_orange.png);
    }
    .coupon_bg3 {
      background-image: url(../../assets/images/coupon_bg_green.png);
    }
    .coupon_bg4 {
      background-image: url(../../assets/images/coupon_bg_pink.png);
    }
    .coupon_bg5 {
      background-image: url(../../assets/images/coupon_bg_purpose.png);
    }
  }
}
.act_toast {
  position: fixed;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  .toast_item {
    width: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    .toast_img {
      width: 100%;
    }
  }
}
footer {
  text-align: center;
  padding: 20px;
  color: #a5a5a5;
}
</style>
